package com.iqiyi.pps.epg.api.server.iservice;

import com.iqiyi.mams.hedvig.http.mediatype.ExtendedMediaType;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * Created by karkarrotxu on 2016/9/6.
 */
@Path("/program")
@Produces({ExtendedMediaType.APPLICATION_X_THRIFT})
public interface ProgramApiService {

    @GET
    @Path("/getRtmpStream")
    @Produces(MediaType.APPLICATION_JSON)
    String getRtmpStream(@QueryParam("qipuId") String qipuId);

    @POST
    @Path("/searchFilter")
    @Produces(MediaType.APPLICATION_JSON)
    public String searchFilterProgram(@FormParam("qipuId") String qipuId,
                                      @FormParam("pname") String programName, @FormParam("cname") String channelName,
                                      @FormParam("startDate") String startDate, @FormParam("endDate") String endDate,
                                      @FormParam("platforms") String platforms);

    @POST
    @Path("/loglist")
    @Produces(MediaType.APPLICATION_JSON)
    public String getProgramLogList(@FormParam("id") String programId, @FormParam("pageNo") Integer pageNo, @FormParam("pageSize") Integer pageSize);

    @POST
    @Path("/list")
    @Produces(MediaType.APPLICATION_JSON)
    public String programList(@FormParam("id") String id,
                              @FormParam("fatherId") String fatherId, @FormParam("startDate") String startDate,
                              @FormParam("endDate") String endDate, @FormParam("pageNo") Integer pageNo,
                              @FormParam("pageSize") Integer pageSize, @FormParam("qipuId") String qipuId,
                              @FormParam("pname") String pname, @FormParam("freeStatus") String freeStatus,
                              @FormParam("bossStatus") String bossStatus, @FormParam("liveProgramType") String liveProgramType,
                              @FormParam("channelName") String channelName, @FormParam("liveType") String liveType,
                              @FormParam("liveChannelType") String liveChannelType, @FormParam("sortType") String sortType,
                              @FormParam("deleteStatus") String deleteStatus, @FormParam("formal") String formal,
                              @FormParam("playStatus") String playStatus, @FormParam("episodeGrade") String episodeGrade,
                              @FormParam("recommendRate") String recommendRate, @FormParam("hot") String hot,
                              @FormParam("test") String test,@FormParam("fromPath") String fromPath);

    @POST
    @Path("/find")
    @Produces(MediaType.APPLICATION_JSON)
    public String currentAndNextProgram(@FormParam("fatherId") String fatherId);


    @GET
    @Path("/search")
    @Produces(MediaType.APPLICATION_JSON)
    public String searchProgram(@QueryParam("name") String name,
                                @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate,
                                @QueryParam("programQipuId") String porgramQipuId,
                                @QueryParam("channelQipuId") String channelQipuId,
                                @QueryParam("channelName") String channelName
    );

    @POST
    @Path("/edit")
    @Produces(MediaType.APPLICATION_JSON)
    public String programEdit(@FormParam("data") String data, @FormParam("imageDatas") String imageDatas);


    @POST
    @Path("/add")
    @Produces(MediaType.APPLICATION_JSON)
    public String programAdd(@FormParam("data") String data, @FormParam("imageDatas") String imageDatas);

    @POST
    @Path("/delete")
    @Produces(MediaType.APPLICATION_JSON)
    public String programDelete(@FormParam("id") String id);


    @POST
    @Path("/toggleLock")
    @Produces(MediaType.APPLICATION_JSON)
    public String programToggleLock(@FormParam("id") String id,
                                    @FormParam("fatherId") String fatherId,
                                    @FormParam("lockType") String lockType);

    @POST
    @Path("/move")
    @Produces(MediaType.APPLICATION_JSON)
    public String programMove(@FormParam("id") String id,
                              @FormParam("flag") String flag,
                              @FormParam("fatherId") String fatherId,
                              @FormParam("operationDay") String operationDay);

    @POST
    @Path("/liveQuery")
    @Produces(MediaType.APPLICATION_JSON)
    public String programInsertQuery(@FormParam("qipuId") String qipuId, @FormParam("pname") String pname,
                                     @FormParam("startDate") String startDate, @FormParam("endDate") String endDate,
                                     @FormParam("minTime") String minTime, @FormParam("maxTime") String maxTime,
                                     @FormParam("pageNo") Integer pageNo, @FormParam("pageSize") Integer pageSize
    );

    @POST
    @Path("/indexMove")
    @Produces(MediaType.APPLICATION_JSON)
    public String programIndexMove(@FormParam("id") String id, @FormParam("aimId") String aimId, @FormParam("dateTime") String dateTime, @FormParam("channelId") String channelId);

    @POST
    @Path("/batchDel")
    @Produces(MediaType.APPLICATION_JSON)
    public String programBatchDel(@FormParam("ids") String ids, @FormParam("dateTime") String dateTime, @FormParam("channelId") String channelId);

    @POST
    @Path("/batchAdd")
    @Produces(MediaType.APPLICATION_JSON)
    public String programBatchAdd(@FormParam("data") String data, @FormParam("beginTime") String beginTime, @FormParam("fatherId") String fatherId);

    @GET
    @Path("/broadcast/control")
    @Produces(MediaType.APPLICATION_JSON)
    public String getProgramBroadcastControl(@QueryParam("programId") long programId);

    @POST
    @Path("/broadcast/control")
    @Produces(MediaType.APPLICATION_JSON)
    public String setProgramBroadcastControl(@FormParam("programId") long programId,
                                             @FormParam("params") String params,
                                             @FormParam("channelId") long channelId);

    @POST
    @Path("/getLivingInfo")
    @Produces(MediaType.APPLICATION_JSON)
    public String getLivingInfo() ;

    @POST
    @Path("/syncTVMao")
    @Produces(MediaType.APPLICATION_JSON)
    public String programSyncTVMao(@FormParam("fatherId") String fatherId);

    @POST
    @Path("/syncProgram")
    @Produces(MediaType.APPLICATION_JSON)
    public String syncProgram(@FormParam("fatherId") String fatherId, @FormParam("programId") String programId);


    @POST
    @Path("/daySort")
    @Produces(MediaType.APPLICATION_JSON)
    public String programDaySort(@FormParam("fatherId") String fatherId, @FormParam("sortDate") String sortDate);

    @POST
    @Path("/queryPuYu")
    @Produces(MediaType.APPLICATION_JSON)
    public String proxyToPuYu(@FormParam("barCode") String barCode, @FormParam("cprVideoName") String cprVideoName);

    @GET
    @Path("/forceCheck")
    @Produces(MediaType.APPLICATION_JSON)
    public String programForceCheck(@QueryParam("id") long programId);

    @POST
    @Path("/streamError")
    @Produces(MediaType.APPLICATION_JSON)
    public String recordStreamError(@FormParam("errorCode") String errorCode,
                                    @FormParam("channelId") String channelId,
                                    @FormParam("programId") String programId,
                                    @FormParam("obj") String obj,
                                    @FormParam("errorAll") String errorAll
    );


    @POST
    @Path("/yesterdayEndTime")
    @Produces(MediaType.APPLICATION_JSON)
    public String getYesterdayEndTime(@FormParam("channelId") String channelId, @FormParam("newStartTime") String newStartTime);


    @GET
    @Path("/maxDuration")
    @Produces(MediaType.APPLICATION_JSON)
    public String programMaxDuration(@QueryParam("fatherId") String fatherId);

    @GET
    @Path("/getNetMonitorInfo")
    @Produces(MediaType.APPLICATION_JSON)
    public String getNetMonitorInfo(@QueryParam("channelQipuId") long channelQipuId);

    @POST
    @Path("/sport/updateTime")
    @Produces(MediaType.APPLICATION_JSON)
    public String updateBySport(@FormParam("programQipuId") String programQipuId,@FormParam("newStartTime") String newStartTime,@FormParam("newStopTime") String newStopTime);

    @POST
    @Path("/sport/unbind")
    @Produces(MediaType.APPLICATION_JSON)
    public String unbindSport(@FormParam("programQipuId") String programQipuId,@FormParam("matchId") String matchId);



    @POST
    @Path("/oainfo")
    @Produces(MediaType.APPLICATION_JSON)
    public String saveOAInfo(@FormParam("data") String data);

}